The technology described herein relates to graphics processing, and in particular to the operation of graphics processing pipelines that perform vertex shading.
Graphics processing is normally carried out by first splitting a scene (e.g. a 3-D model) to be displayed into a number of similar basic components or “primitives”, which primitives are then subjected to the desired graphics processing operations. The graphics “primitives” are usually in the form of simple polygons, such as triangles.
Each primitive is usually defined by and represented as a set of vertices, where each vertex typically has associated with it a set of “attributes”, i.e. a set of data values for the vertex. These attributes will typically include position data and other, non-position data (varyings), e.g. defining colour, light, normal, texture coordinates, etc., for the vertex in question.
For a given output, e.g. frame to be displayed, to be generated by the graphics processing system, there will typically be a set of vertices defined for the output in question. The primitives to be processed for the output will then be indicated as comprising given vertices in the set of vertices for the graphics processing output being generated. Typically, the overall output, e.g. frame to be generated, will be divided into smaller units of processing, referred to as “draw calls”. Each draw call will have a respective set of vertices defined for it and a set of primitives that use those vertices.
Once primitives and their vertices have been generated and defined, they can be processed by the graphics processing system, in order to generate the desired graphics processing output (render target), such as a frame for display. This basically involves rasterising and rendering the primitives to generate the graphics processing output.
The rasterising and rendering processes use the vertex attributes associated with the vertices of the primitives that are being processed. To facilitate this operation, the attributes of the vertices defined for the given graphics processing output (e.g. draw call) are usually subjected to an initial so-called “vertex shading” operation, before the primitives are rasterised and rendered. This “vertex shading” operation operates to transform the attributes for each vertex into a desired form for the subsequent graphics processing operations. This may comprise, for example, transforming vertex position attributes from the world or user space that they are initially defined for to the screen space that the output of the graphics processing system is to be displayed in.
A graphics processing pipeline will typically therefore include a vertex shading stage (a vertex shader) that executes vertex shading computations on the initial vertex attribute values defined for the vertices so as to generate a desired set of output vertex attributes (i.e. appropriately “shaded” attributes) for use in subsequent processing stages of the graphics processing pipeline.
Once the vertex attributes have been shaded, the “shaded” attributes are then used when processing the vertices (and the primitives to which they relate) in the remainder of the graphics processing pipeline.
(In general “input variables” and “output variables” are the generic terms used for inputs and outputs from shaders (shading stages) in graphics processing pipelines. Before being vertex shaded, a vertex is a collection of “generic vertex attributes” that can be accessed within the vertex shader as input variables. The vertex shader execution then produces a vertex position and any outputs explicitly written by the vertex shader. “Varyings” are the attributes communicated from the vertex shader to rasterisation and fragment shading, not including position. (Thus only the non-position outputs from the vertex shader are “varyings”.))
One form of graphics processing pipeline is a so called tile-based graphics processing pipeline, wherein the two-dimensional render output or target is rendered as a plurality of smaller area sub-regions, usually referred to as “tiles”. The tiles are each rendered separately (typically one after another). The rendered tiles are then combined to provide the complete rendering output (e.g. frame for display).
(Other terms that are commonly used for “tiling” and “tile-based” rendering include “chunking” (the rendering tiles are referred to as “chunks”) and “bucket” rendering. The terms “tile” and “tiling” will be used hereinafter for convenience, but it should be understood that these terms are intended to encompass all alternative and equivalent terms and techniques.)
The Applicants believe that there remains scope for improvements for graphics processing pipelines that employ vertex shading.
Like reference numerals are used for like components in the Figures.